<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>菜单管理</title>
    <link rel="stylesheet" href="../../assets/libs/layui/css/layui.css" />
    <link rel="stylesheet" href="../../assets/module/admin.css?v=314" />
    <link rel="stylesheet" href="../../assets/css/publicStyle.css">
    <link rel="stylesheet" href="../../assets/libs/ztree/css/zTreeStyle/zTreeStyle.css">
    <!--[if lt IE 9]>
    <script src="../../assets/libs/html5shiv.min.js"></script>
    <script src="../../assets/libs/respond.min.js"></script>
    <![endif]-->
    <style>
        .layui-fluid .layui-card {
            height: calc(100vh - 30px);
            overflow: auto;
        }
        #AddResourceForm textarea{
            width: 100% !important;
        }
        #AddResourceForm input{
            width: 100% !important;
        }
        #editResourceForm textarea{
            width: 100% !important;
        }
        #editResourceForm input{
            width: 100% !important;
        }
    </style>
</head>

<body>

    <!-- 页面加载loading -->
    <div class="page-loading">
        <div class="ball-loader">
            <span></span><span></span><span></span><span></span>
        </div>
    </div>

    <!-- 正文开始 -->
    <div class="layui-fluid">
        <div class="layui-card">
            <div class="layui-card-body">
                <div class="layui-form toolbar">
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <button id="btnAddAuth" class="layui-btn icon-btn layui-btn-sm"><i
                                    class="layui-icon">&#xe654;</i>新增</button>
                            <button id="btnRefreshAuth" class="layui-btn icon-btn layui-btn-sm"><i
                                    class="layui-icon">&#xe669;</i>刷新</button>
                        </div>
                    </div>
                </div>

                <table class="layui-table" id="tableAuth" lay-filter="tableAuth"></table>
            </div>
        </div>
    </div>

    <!-- 表格操作列 -->
    <script type="text/html" id="tableBarAuth">
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="add">新增</a>
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="edit">编辑</a>
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>
    <style>
        .modle-version {
            position: absolute;
            left: 0;
            top: 42px;
            padding: 5px 0;
            z-index: 899;
            min-width: 100%;
            border: 1px solid #d2d2d2;
            max-height: 300px;
            overflow-y: auto;
            background-color: #fff;
            border-radius: 2px;
            box-shadow: 0 2px 4px rgba(0,0,0,.12);
            box-sizing: border-box;
            max-height: 200px;
            overflow-x: hidden;
            overflow-y: auto;
            display: none;
        }

        .edit-modle-version {
            position: absolute;
            left: 0;
            top: 42px;
            padding: 5px 0;
            z-index: 899;
            min-width: 100%;
            border: 1px solid #d2d2d2;
            max-height: 300px;
            overflow-y: auto;
            background-color: #fff;
            border-radius: 2px;
            box-shadow: 0 2px 4px rgba(0,0,0,.12);
            box-sizing: border-box;
            max-height: 200px;
            overflow-x: hidden;
            overflow-y: auto;
            display: none;
        }
    </style>
    <!-- 新增菜单弹窗 -->
    <script type="text/html" id="AddResourceModel">
    <form id="AddResourceForm" lay-filter="AddResourceForm" class="layui-form model-form">
        <div class="layui-form-item">
            <label class="layui-form-label">部门名称</label>
            <div class="layui-input-block">
                <input name="name" placeholder="请输入部门名称" type="text" class="layui-input" maxlength="50"
                       lay-verType="tips" lay-verify="required" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">部门全称</label>
            <div class="layui-input-block">
                <input name="fullName" placeholder="请输入部门全称" type="text" class="layui-input" maxlength="50"
                       lay-verType="tips" lay-verify="required" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">地址</label>
            <div class="layui-input-block">
                <input name="address" placeholder="请输入地址" type="text" class="layui-input" maxlength="50"
                       lay-verType="tips"/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">部门编码</label>
            <div class="layui-input-block">
                <input name="code" placeholder="请输入部门编码" type="text" class="layui-input" maxlength="50"
                       lay-verType="tips" lay-verify="required" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">联系电话</label>
            <div class="layui-input-block">
                <input name="contactNumber" placeholder="请输入电话" type="text" class="layui-input" maxlength="50"
                       lay-verType="tips" lay-verify="contactNumber" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">邮箱</label>
            <div class="layui-input-block">
                <input name="email" placeholder="请输入邮箱" type="text" class="layui-input" maxlength="50"
                       lay-verType="tips" lay-verify="email" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">传真</label>
            <div class="layui-input-block">
                <input name="fax" placeholder="请输入传真号" type="text" class="layui-input" maxlength="50"
                       lay-verType="tips" lay-verify="fax" />
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">部门负责人</label>
            <div class="layui-input-block">
                <select name="leadingOffical" id="leadingOffical" lay-verify="" lay-filter="leadingOffical">
           
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">备注</label>
            <div class="layui-input-block">
                <textarea name="memo" placeholder="请输入备注信息" class="layui-textarea"
                lay-verType="tips" lay-verify="" ></textarea>
            </div>
        </div>

        <div class="layui-form-item" id="addParentId" style="display:none">
            <label class="layui-form-label">父级部门</label>
            <div class="layui-input-block">
                <input name="parentId" placeholder="" disabled type="text" class="layui-input" maxlength="50"
                       lay-verType="tips"/>
            </div>
        </div>
        <div class="layui-form-item" id="region_version">
            <label class="layui-form-label">区划版本</label>
            <div class="layui-input-block">
                <select name="regionVersion" id="regionVersion" lay-verify="" lay-filter="regionVersion">
           
                </select>
                <div class="modle-version">
                        <ul id="treeTbTree" class="ztree" ></ul>
                </div>
            </div>
        </div>
        <div class="layui-form-item" id="region_code">
            <label class="layui-form-label">区划代码</label>
            <div class="layui-input-block">
                <input name="regionCode" placeholder="" id="region_code_text" disabled type="text" class="layui-input" maxlength="50"
                       lay-verType="tips" lay-verify="regionCode" />

            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">排序字段</label>
            <div class="layui-input-block">
                <input name="sort" placeholder="请输入排序字段" type="text" class="layui-input" maxlength="50"
                       lay-verType="tips" lay-verify="required" />
            </div>
        </div>        <div class="layui-form-item">
        <label class="layui-form-label">网页</label>
        <div class="layui-input-block">
            <input name="website" placeholder="" type="text" class="layui-input" maxlength="50"
                   lay-verType="tips" lay-verify="website" />
        </div>
    </div>
        <div class="layui-form-item">
            <label class="layui-form-label">邮政编码</label>
            <div class="layui-input-block">
                <input name="zipCode" placeholder="请输入邮政编码" type="text" class="layui-input" maxlength="50"
                       lay-verType="tips" lay-verify="zipCode" />
            </div>
        </div>

        <div class="layui-form-item text-right">
            <button class="layui-btn layui-btn-primary" type="button" ew-event="closePageDialog">取消</button>
            <button class="layui-btn" lay-filter="modelSubmitAuth" lay-submit>保存</button>
        </div>
    </form>
</script>
    <!--渲染负责人列表-->
    <script type="text/tmpl" id="template-leadingOffical-tmpl">
    <option value=""></option>
     {{each leadingOfficalPerson}}
        <option value="{{$value.userId}}">{{$value.username}}</option>
    {{/each}}

</script>
    <!--渲染版本-->
    <script type="text/tmpl" id="template-version-tmpl">
    <option value=""></option>
     {{each regionCatalogType}}
        <option value="{{$value.id}}">{{$value.name}}</option>
    {{/each}}

</script>
    <!-- 编辑菜单弹窗 -->
    <script type="text/html" id="editResourceModel">
    <form id="editResourceForm" lay-filter="editResourceForm" class="layui-form model-form">
        <div class="layui-form-item">
            <label class="layui-form-label">部门名称</label>
            <div class="layui-input-block">
                <input name="name" placeholder="请输入部门名称" type="text" class="layui-input" maxlength="50"
                       lay-verType="tips" lay-verify="required" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">部门全称</label>
            <div class="layui-input-block">
                <input name="fullName" placeholder="请输入部门全称" type="text" class="layui-input" maxlength="50"
                       lay-verType="tips" lay-verify="required" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">地址</label>
            <div class="layui-input-block">
                <input name="address" placeholder="请输入地址" type="text" class="layui-input" maxlength="50"
                       lay-verType="tips"/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">部门编码</label>
            <div class="layui-input-block">
                <input name="code" placeholder="请输入部门编码" type="text" class="layui-input" maxlength="50"
                       lay-verType="tips" lay-verify="required" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">联系电话</label>
            <div class="layui-input-block">
                <input name="contactNumber" placeholder="请输入联系电话" type="text" class="layui-input" maxlength="50"
                       lay-verType="tips" lay-verify="contactNumber" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">邮箱</label>
            <div class="layui-input-block">
                <input name="email" placeholder="请输入邮箱" type="text" class="layui-input" maxlength="50"
                       lay-verType="tips" lay-verify="email" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">传真</label>
            <div class="layui-input-block">
                <input name="fax" placeholder="请输入传真号" type="text" class="layui-input" maxlength="50"
                       lay-verType="tips" lay-verify="fax" />
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">部门负责人</label>
            <div class="layui-input-block">
                <select name="leadingOffical" id="edit_leadingOffical" lay-verify="" lay-filter="leadingOffical">
           
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">备注</label>
            <div class="layui-input-block">
                <textarea name="memo" placeholder="请输入备注" class="layui-textarea"
                lay-verType="tips" lay-verify="" ></textarea>
            </div>
        </div>

        <div class="layui-form-item" id="addParentId" style="display:none">
            <label class="layui-form-label">父级部门</label>
            <div class="layui-input-block">
                <input name="parentId" placeholder="" disabled type="text" class="layui-input" maxlength="50"
                       lay-verType="tips"/>
            </div>
        </div>
        <div class="layui-form-item" id="region_version">
            <label class="layui-form-label">区划版本</label>
            <div class="layui-input-block">
                <select name="regionVersion" id="edit_regionVersion" lay-verify="" lay-filter="edit_regionVersion">
           
                </select>
                <div class="edit-modle-version">
                        <ul id="edit_tree" class="ztree" ></ul>
                </div>
            </div>
        </div>
        <div class="layui-form-item" id="region_code_edit">
            <label class="layui-form-label">区划代码</label>
            <div class="layui-input-block">
                <input name="regionCode" placeholder="" id="edit_region_code_text" disabled type="text" class="layui-input" maxlength="50"
                       lay-verType="tips" lay-verify="regionCode" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">排序字段</label>
            <div class="layui-input-block">
                <input name="sort" placeholder="请输入排序字段" type="text" class="layui-input" maxlength="50"
                       lay-verType="tips" lay-verify="required" />
            </div>
        </div>        <div class="layui-form-item">
        <label class="layui-form-label">网页</label>
        <div class="layui-input-block">
            <input name="website" placeholder="" type="text" class="layui-input" maxlength="50"
                   lay-verType="tips" lay-verify="website" />
        </div>
    </div>
        <div class="layui-form-item">
            <label class="layui-form-label">邮政编码</label>
            <div class="layui-input-block">
                <input name="zipCode" placeholder="请输入邮政编码" type="text" class="layui-input" maxlength="50"
                       lay-verType="tips" lay-verify="zipCode" />
            </div>
        </div>
        <div class="layui-form-item text-right">
            <button class="layui-btn layui-btn-primary" type="button" ew-event="closePageDialog">取消</button>
            <button class="layui-btn" lay-filter="modelSubmitAuth" lay-submit>保存</button>
        </div>
    </form>
</script>

    <!-- js部分 -->
    <script type="text/javascript" src="../../assets/libs/layui/layui.js"></script>
    <script type="text/javascript" src="../../assets/js/common.js?v=314"></script>
    <script src="../../assets/libs/jquery/jquery-3.2.1.min.js"></script>
    <!-- Ztree树部分 -->
    <script src="../../assets/libs/ztree/js/jquery.ztree.core.min.js"></script>
    <script src="../../assets/libs/ztree/js/jquery.ztree.exedit.js"></script>
    <script src="../../assets/libs/ztree/js/jquery.ztree.excheck.min.js"></script>

    <script src="../../assets/libs/template-web.js"></script>
    <script src="../../assets/libs/axios.min.js"></script>
    <script src="../../assets/js/config.js"></script>
    <script src="../../assets/js/authority.js"></script>
    <script src="../../assets/js/config/region.js"></script>
    <script src="../../assets/js/system/organization.js"></script>

</body>

</html>